export function getValue(key) {
  return localStorage.getItem('lxnsy-' + key)
}
export function setValue(key, value) {
  return localStorage.setItem('lxnsy-' + key, value)
}

// { expires: 365 }
export function setObject(object) {
  for (const key in object) {
    localStorage.setItem('lxnsy-' + key, object[key])
  }
}

export function clearValue(key) {
  localStorage.removeItem('lxnsy-' + key)
}
export function clear() {
  const keys = Object.keys(localStorage)
  keys.forEach(key => {
    if (key.indexOf('lxnsy-') === 0) {
      localStorage.removeItem(key)
    }
  })
}
